using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace PicAFlick.App
{
    public partial class FolderView : UserControl
    {

        private PicAFlick.Domain.Folder _folder;

        public PicAFlick.Domain.Folder Folder
        {
            get { return _folder; }
            set
            {
                _folder = value;
                if (_folder != null)
                {
                    Label l = new Label();
                    l.Text = "Loading.......";
                    this.Controls.Add(l);
                    this.flowLayoutPanel1.Visible = false;
                    Application.DoEvents();
                    this.flowLayoutPanel1.Controls.Clear();
                    foreach (PicAFlick.Domain.ImageDetails id in _folder.Images)
                    {
                        this.flowLayoutPanel1.Controls.Add(new ThumbnailImageDisplay(id));
                    }
                    this.Controls.Remove(l);
                    this.flowLayoutPanel1.Visible = true;
                }
            }
        }
        
        
        public FolderView()
        {
            InitializeComponent();
        }
    }
}
